-
Notifications
You must be signed in to change notification settings - Fork 764
Enable v2 syntax parser by default #6643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for nextflow-docs-staging canceled.
|
f8167ff to
4af065f
Compare
|
@claude please review |
|
Claude finished @bentsherman's task —— View job Code Review: Enable strict syntax by defaultReviewing the changes to enable strict syntax (v2 parser) by default and deprecate the Review Tasks:
Review SummaryThis is a major but well-executed change that enables strict syntax by default in Nextflow. The implementation is thorough and the extensive test updates demonstrate careful attention to maintaining compatibility while enforcing stricter parsing rules. Positive Aspects1. Clean Implementation of Default Change
2. Comprehensive Test Consolidation
3. Documentation Updates
4. Extensive Test Coverage
Areas for Improvement1. Error Handling in ScriptLoaderV2// ScriptLoaderV2.groovy:54-55
if( name )
throw new IllegalArgumentException("The `-entry` option is not supported with the strict syntax -- use a param to run a named workflow from the entry workflow")Concern: This error message could be more helpful. Consider:
2. Configuration Parser Strictness// ConfigParserV2.groovy:48
private boolean strict = trueConcern: The v2 parser defaults to strict mode, but this could cause issues for users with complex config files that haven't been updated yet. Consider:
3. Missing Migration Path for Complex CasesConcern: While documentation covers many cases, some complex Groovy patterns in configs might need more guidance:
4. Test File OrganizationObservation: Good cleanup of obsolete test utilities, but ensure all functionality is preserved in the new Technical Implementation Review1. Parser Selection LogicThe implementation correctly uses environment variable to control parser selection: // NF.groovy:36
static String getSyntaxParserVersion() {
return SysEnv.get('NXF_SYNTAX_PARSER', 'v2')
}This provides a clean escape hatch for users who need v1 behavior. 2. Backward CompatibilityThe changes maintain good backward compatibility:
3. AST TransformationsThe visitor pattern changes in Recommendations1. Consider Phased Rollout
2. Enhanced Error Messages
3. Documentation Enhancements
4. Monitoring Plan
Breaking Changes AssessmentImpact Level: Medium to High - This is a breaking change for some users, but: ✅ Mitigated by:
Overall AssessmentRecommendation: APPROVE This is a well-implemented and necessary step forward for Nextflow. The change:
The extensive test modifications (2072 additions, 3888 deletions) indicate thorough validation of the changes across the codebase. Suggested Follow-up Actions
|
|
Related: A check on how many nf-core pipelines will break when we release this 😅 |
|
Better let them know it's coming! |
|
That's the idea! Can't do much without #6623 being fixed though. How does the timing look for merging? Is it worth moving the above fix out into its own PR for a quicker merge? We can't make the template strict-syntax compliant without that, which means that no nf-core pipelines can update until it's fixed. |
pditommaso
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this PR mixes two things: stabilising/improving the strict parser + promoting v2 as default. I believe this should happen in separate steps, ie. stabilise first, battle test it into an edge, then promote the strict parser as default.
These goals are fundamentally intertwined. Making v2 the default makes it so that all of the unit tests use the v2 parser, which surfaces any remaining gaps. For example, #6623 would have been caught by a unit test in So I see little difference between merging the two changes together vs separately. Battle-testing is what edge is for. We're already planning to make v2 the default in 26.04 so we might as well do it now |
|
Whilst it scares me, I generally agree with Ben here..
In order to really battle test it in an edge release, it needs to be the default in the edge release. |
|
Why? would not be enough to enable v2 in the nf-core tests suite? |
|
We can do that (though it's not trivial as it requires a template update, and we try not to push these too frequently), but I'm more thinking about people beyond nf-core. If it's going to be default in the next stable release, I'd prefer to make it default in an edge release ASAP and then shout about it a lot. There's no way that this isn't going to cause some disruption when it comes out, so the longer it sits in an edge release the better. |
Really, for setting a env variable? We can accelerate the cadence of edge releases for testing this more frequently, but from my point of view the switch should be done when there's any code/structural change. |
Signed-off-by: Ben Sherman <[email protected]>
70e4aa3 to
fddc310
Compare
Yes, because we would need to update the GitHub actions workflow scripts to do this. That involves a change to the pipeline template, which needs a release of tools, automatic sync, and for every pipeline to fix template merge conflicts, merge the automated template update PR, and do a release of their pipeline. This process typically takes several months from start to end. We have talked about switching to using centralised / shared GitHub actions scripts, but this hasn't happened yet. And if we did that it probably wouldn't go down well, as flipping on the ENV var would immediately break all CI and no-one would be able to merge any PRs. Releasing it as default in an edge release avoids all of this. We already have CI jobs in all pipelines that run on edge, don't block PRs but do alert authors to the fact that there is an upcoming breaking change. |
|
@ben, regarding the ConfigBuilder issue I commented to you yesterday in the call, this is the part of code I was referring to: This is using I think |
|
Apart from my previous comment, I would also be in favor to merge and release in an edge. In case we get terrible feedback, the changes seem to be valid for both parsers, so reverting to V1 again will be just modifying the line to set the default again to V1 and the corresponding docs. |
@jorgee it's fine, the strict check in |
Signed-off-by: Paolo Di Tommaso <[email protected]>
Signed-off-by: Ben Sherman <[email protected]>
|
We are now tracking strict syntax errors across all nf-core pipelines / modules / subworkflows: https://github.com/nf-core/strict-syntax-health (thanks a ton @ewels !) I will continue to monitor the results and do what I can to ease the transition. I can make sure that error messages are clear, but at the end of the day it's up to pipeline developers to update their code. They can always set Looking over the error reports, I think most pipelines can be brought into compliance without too much hassle. |
NXF_SYNTAX_PARSERtov2by defaultnextflow.enable.strictfeature flagScriptHelper